Version 3.0 User's Guide |
|
Commands: File Information |
Previous |
Next Contents |
The INSERT_MODIFIED command allows you to easily insert the date that the given file was last modified.
The filepath parameter may be either relative to the Root Folder, or relative to the location of the page being served. It may be specified using either the URL style for file paths (using slash '/' characters to delimit folder names), or the MacOS style (using colons ':' to delimit folder names). If the first character of the file path is a colon or a slash, the file path is assumed to be relative to the Root Folder. Otherwise, it is assumed to be relative to the location of the page being served. For example, if the Root Folder is "MacHD:Web:", then the command:
<INSERT_MODIFIED "/news/latest.html">
...will always insert the last-modified date of the file:
MacHD:Web:news:latest.html
If the command:
<INSERT_MODIFIED "local/weather.html">
...is located in the file:
MacHD:Web:usa:indiana:default.html
...then NetCloak will insert the last-modified date of the file:
MacHD:Web:usa:indiana:local:weather.html
...into the web page when it is served. If the file path contains spaces, be sure to put it in double-quotes.
If the filepath parameter is missing, then the command will display the last modified date of the current page being served. For example, many pages may end in:
This page last updated on <INSERT_MODIFIED>.
The remaining two optional parameters works the same way as they do in the INSERT_DATE command.
The offset parameter lets you specify an offset from the file's modification date, in fractions of hours. For example, the following command:
<INSERT_MODIFIED "news.html" +168>
...will insert a date 7 days after the file "newstuff.html" (located in the same folder as the current page) was last modified. Why is this useful? When this command is nested inside a SHOW_DATE command, it gives you an easy way to automatically highlight files for a period of time whenever they are updated on your web site. The following code will automatically append a "New!" graphic to the hypertext link for seven days whenever the linked page is updated:
<A HREF="news.html">Recent News</A> <HIDE><SHOW_DATE LT <INSERT_MODIFIED "news.html" +168>> <IMG SRC="new.gif"> <SHOW> <BR>
The format of the date inserted will depend on the date format you have selected in the Date & Time control panel, as well as the date format setting in NetCloak. See the "Configuring NetCloak" section below for more information on the way that NetCloak formats dates.
You can override the default date format setting by specifying either "SHORT" or "LONG" in the format parameter. The Date & Time control panel allows you to configure two date formats: a long format and a short format, and the "format" parameter allows you to select which should be used to display the date. The format may be specified without specifying an offset.
The command can also be particularly useful in macros, where a single macro (perhaps a footer) may be used on many pages. In this case, the INSERT_MODIFIED command need only appear in a single macro but will always display the modification date of the page that has been served.
Note that if you use the INSERT_MODIFIED command inside a page that is not stored on disk (such as from a back-end CGI), NetCloak will not be able to determine a modified date and will insert the current date instead.
This command inserts the size of the specified file as it is stored on disk. If a filepath is not specified, the size of the page being served is given. There are three variations of the command, including "INSERT_FILESIZE_B", "INSERT_FILESIZE_K", and "INSERT_FILESIZE_M" for displaying the size of the file in either bytes, kilobytes, or megabytes, respectively.
The filepath parameter may also refer to any file on the web server. Like all paths specified in NetCloak, when the path begins with a slash ("/"), the path is relative to the root folder defined in the NetCloak Configuration window. Here are some examples:
<INSERT_FILESIZE_B /MyFile.sit.hqx> <INSERT_FILESIZE_K /Folder/Moof.hqx> <INSERT_FILESIZE_M /BigFile.sit.hqx>
The first example is a file ("MyFile.sit.hqx") that resides in the root folder and the size is displayed in bytes. The second example gives the size, in kilobytes, of a file in a folder named "Folder" contained in the root folder. The last example shows the number of megabytes used by a file in the root folder.
Displaying the size in bytes will always show the exact size of the file, while displaying kilobytes will cause NetCloak to round up to the nearest kilobyte. When displaying the size in megabytes, NetCloak will round up to the nearest tenth of a megabyte.
Copyright © 1996-1999 Maxum Development Corporation http://www.maxum.com/ |
Previous |
Next Contents |